<template>
  <div class="index-container">
    <Header></Header>
    <div class="warpper">
      <van-form>
        <van-field v-model="selfUserInfo.id" name="id" label="主键" placeholder="主键" readonly v-show="false"/>
        <van-field
          v-model="selfUserInfo.user_id"
          name="user_id"
          label="用户主键"
          placeholder="用户主键"
          readonly
          v-show="false"
        />
        <van-field v-model="selfUserInfo.fakexm" name="fakexm" label="姓名" placeholder="姓名" readonly disabled/>
        <van-field name="xb" label="性别" readonly disabled>
          <template #input>
            <van-radio-group v-model="selfUserInfo.xb" direction="horizontal" disabled>
              <van-radio name="male">男</van-radio>
              <van-radio name="female">女</van-radio>
            </van-radio-group>
          </template>
        </van-field>
        <van-field
          v-model="selfUserInfo.fakeidcard"
          name="fakeidcard"
          label="证件号码"
          placeholder="证件号码"
          readonly
          disabled
        />
        <van-field
          v-model="selfUserInfo.faketel"
          name="faketel"
          label="手机号码"
          placeholder="手机号码"
          readonly
          disabled
        />
        <!--        <van-field-->
        <!--          v-model="selfUserInfo.sfcjkms"-->
        <!--          name="sfcjkms"-->
        <!--          label="是否参加开幕式"-->
        <!--          placeholder="是否参加开幕式"-->
        <!--          readonly-->
        <!--        />-->
        <van-field
          v-model="selfUserInfo.sfcjbms"
          name="sfcjbms"
          label="是否参加闭幕式"
          placeholder="是否参加闭幕式"
          v-show="false"
          readonly
        />
        <!--是否参加闭幕式-->
        <!--        <van-field-->
        <!--          readonly-->
        <!--          name="sfcjbmsValue"-->
        <!--          :value="selfUserInfo.sfcjbmsValue"-->
        <!--          label="是否参加闭幕式"-->
        <!--          placeholder="点击选择是否参加闭幕式"-->
        <!--          :rules="[{ required: true, message: '请填写是否参加闭幕式' }]"-->
        <!--        />-->
        <van-field
          readonly
          v-model="selfUserInfo.kmszw"
          name="kmszw"
          label="开幕式座位号"
          placeholder="开幕式座位号"
        />
        <van-field
          readonly
          v-model="selfUserInfo.bmszw"
          name="bmszw"
          label="闭幕式座位号"
          placeholder="闭幕式座位号"
        />

        <van-field
          v-model="selfUserInfo.zsjdmz"
          name="zsjdmz"
          label="住宿酒店"
          placeholder="住宿酒店"
          readonly
        />
        <van-field
          v-model="selfUserInfo.zsjddz"
          name="zsjddz"
          label="酒店地址"
          placeholder="酒店地址"
          readonly
          type="textarea"
          rows="1"
          autosize
        />
        <!--        <van-field-->
        <!--          v-model="selfUserInfo.zsjdfjh"-->
        <!--          name="zsjdfjh"-->
        <!--          label="酒店房间号"-->
        <!--          placeholder="酒店房间号"-->
        <!--          readonly-->
        <!--        />-->
        <van-field
          v-model="selfUserInfo.breakfast"
          name="breakfast"
          label="早餐安排"
          placeholder="早餐安排"
          readonly
        />
        <van-field
          v-model="selfUserInfo.lunch"
          name="lunch"
          label="午餐安排"
          placeholder="午餐安排"
          readonly
        />
        <van-field
          v-model="selfUserInfo.dinner"
          name="dinner"
          label="晚餐安排"
          placeholder="晚餐安排"
          readonly
        />
        <van-field
          v-model="selfUserInfo.jdycdd"
          name="jdycdd"
          label="酒店用餐地点"
          placeholder="酒店用餐地点"
          readonly
        />

        <van-field
          v-model="selfUserInfo.scycdd"
          name="scycdd"
          label="赛场用餐地点"
          placeholder="赛场用餐地点"
          readonly
        />

        <van-field
          v-model="selfUserInfo.spgmbz"
          name="spgmbz"
          label="禁忌(过敏)食物"
          placeholder="禁忌(过敏)食物"
          readonly
          type="textarea"
          rows="1"
          autosize
        />
        <van-field
          v-model="selfUserInfo.djllrxm"
          name="djllrxm"
          label="对接联络人"
          placeholder="对接联络人"
          readonly
        />
        <van-field
          v-model="selfUserInfo.djllrtel"
          name="djllrTel"
          label="联络人手机号码"
          placeholder="联络人手机号码"
          readonly
        />
      </van-form>
    </div>

    <!--      通用picker组件-->
    <van-popup v-model="commonPicker" position="bottom">
      <van-picker
        value-key="value"
        show-toolbar
        :columns="commonColumns"
        @confirm="commonOnConfirm"
        @cancel="commonPicker = false"
      />
    </van-popup>
  </div>
</template>

<script>
import { getSelfInfo } from '@/utils/tokenUtil'
import minixCommonPicker from '../../minix/minixCommonPicker'
import { codeList } from '@/utils/code'
import { getRealArrData } from '@/utils/'

export default {
  name: 'HotelInfo',
  mixins: [minixCommonPicker], //复用mixin
  data() {
    return {
      selfUserInfo: {},
      commonPicker: false,
      commonColumns: [],
      commonFieldName: ''
    }
  },
  created() {
    this.loadHotelInfo()
  },
  methods: {
    loadHotelInfo() {
      this.selfUserInfo = getSelfInfo()
      this.getArrData('sfcjbms', this.selfUserInfo.sfcjbms, codeList.sfcjbms)
    },
    getArrData(field, key, arr) {
      // 获取真实的字段代码值
      arr = getRealArrData(arr)
      let data = arr.filter(item => item.key == key)
      if (data.length > 0) {
        this.$set(this.selfUserInfo, field + 'Value', data[0].value)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.health {
  font-size: 0.6rem;
  font-weight: bold;
  background: white;
  margin: 0;
  padding: 20px 10px 10px;
}

/deep/ .van-checkbox {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 10px;
  }
}
</style>
